import { defineStore } from 'pinia';
import axios from '../api/request.ts';

export const useActivityStore = defineStore('activity', {
    state: () => ({
        activities: [] as any[],
    }),
    actions: {
        async fetchActivities() {
            try {
                const response = await axios.get('/activities');
                this.activities = response.data;
            } catch (error) {
                console.error('Error fetching activities:', error);
            }
        },
    },
});